package com.attilax.faceRecoge;
import java.io.File;

import org.json.JSONObject;

import com.facepp.error.FaceppParseException;
import com.facepp.http.HttpRequests;
import com.facepp.http.PostParameters;


public class test2 {
	
	public static void main(String[] args) throws FaceppParseException {
	String f="e:\\122155TP4.jpg";
	//replace api_key and api_secret here (note)
	HttpRequests httpRequests = new HttpRequests("4480afa9b8b364e30ba03819f3e9eff5", "Pz9VFT8AP3g_Pz8_dz84cRY_bz8_Pz8M ", true, true);
	System.out.println("FacePlusPlus API Test:");
	
	//detection/detect
	PostParameters postParameters = new PostParameters();
	postParameters.setImg(new File(f));
	//postParameters.setUrl("http://cn.faceplusplus.com/wp-content/themes/faceplusplus/assets/img/demo/9.jpg")
	JSONObject result = httpRequests.detectionDetect(postParameters);
	System.out.println(result);
	//FacePlusPlus API Test:
	//{"face":[{"position":{"mouth_right":{"y":41.817167,"x":52.828667},"mouth_left":{"y":41.020833,"x":48.473333},"center":{"y":39.583333,"x":51.222222},"height":7.166667,"width":9.555556,"nose":{"y":40.304167,"x":51.306},"eye_left":{"y":37.842,"x":49.345111},"eye_right":{"y":38.690667,"x":54.230222}},"tag":"","face_id":"e0e867f62dff984a726db46466aaa619","attribute":{"age":{"range":7,"value":18},"gender":{"value":"Female","confidence":99.97},"race":{"value":"Asian","confidence":96.9747},"smiling":{"value":82.052}}}],"session_id":"5f34e92cf66148978642d6b23749dbc8","img_id":"bff7873b3636c85d41168d003e941f34","response_code":200,"img_height":1200,"img_width":900,"url":null}

	}

}
